import Api from '@/api/payment/banks'
import i18n from "@/lang/index";
const modalConfig = {
  pageName: 'sys:user',
  dialog: {
    title: i18n.global.t("title.35"),
    width: 800,
    appendToBody: true,
    draggable: true,
    labelWidth: "auto",
  },
  formAction: (data) => {
    console.log('edit', data)
    return new Promise((resolve, reject) => {
      Api.put(data).then((s) => {
        console.log(s)
        resolve(s)
      }).catch((e) => {
        reject(e)
      })
    })
  },
  formItems: [
    {
      type: "input",
      label: "ID",
      prop: "id",
      attrs: {
        disabled: true
      },
      hidden: true
    },
    {
      type: "input",
      label: i18n.global.t("label.160"),
      prop: "name",
      attrs: {
        placeholder: i18n.global.t("hint.153"),
      }
    },
    {
      type: "input",
      label: i18n.global.t("label.161"),
      prop: "code",
      attrs: {
        placeholder: i18n.global.t("hint.154"),
      },
    },
    {
      type: "input",
      label: i18n.global.t("label.162"),
      prop: "currency_code",
      attrs: {
        placeholder: i18n.global.t("hint.155"),
      },
    },
  ],
  formRules: {
    name: [{ required: true, message: i18n.global.t("hint.153"), trigger: "blur" }],
    code: [{ required: true, message: i18n.global.t("hint.154"), trigger: "blur" }],
    currency_code: [{ required: true, message: i18n.global.t("hint.155"), trigger: "blur" }],
  }
}

export default modalConfig
